﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QLKetNoi;
using QLPhanQuyen.DAO;
using System.Data.Linq;

namespace QLPhanQuyen.BO
{
    public class NguoiDungBO
    {
        NguoiDungDAO NDDAO = new NguoiDungDAO();
        
        public bool ThemNguoiDung(NGUOIDUNG ND)
        {
            return NDDAO.ThemNguoiDung(ND);
        }

        public string MaCaoNhat()
        {
            return NDDAO.MaCaoNhat();
        }

        public bool KiemTraTonTai( string taiKhoan)
        {
            return NDDAO.KiemTraTonTai(taiKhoan);
        }

        public bool KiemTraDangNhap(string taiKhan, string matKhau)
        {
            return NDDAO.KiemTraDangNhap(taiKhan, matKhau);
        }

        public bool KiemTraTaiKhoanPhanQuyen(string taiKhoan, string maVaiTro)
        {
            return NDDAO.KiemTraTaiKhoanPhanQuyen(taiKhoan, maVaiTro);
        }
        
        public bool KiemTraThuocNhomAdmin(string taiKhoan)
        {
            return NDDAO.KiemTraThuocNhomAdmin(taiKhoan);
        }

        public bool DoiMatKhau(string taiKhoan, string matKhauMoi)
        {
            return NDDAO.DoiMatKhau(taiKhoan, matKhauMoi);
        }

        public string LayMaTheoTen(string tenNguoiDung)
        {
            return NDDAO.LayMaTheoTen(tenNguoiDung);
        }

        public bool SuaNguoiDung(string ten, string taikhoan, string matkhau,
            string mavaitro, string nhom, bool trangthai, string diengiai)
        {
            return NDDAO.SuaNguoiDung(ten, taikhoan, matkhau, mavaitro, nhom, trangthai, diengiai);
        }

        public Table<NGUOIDUNG> DanhSachNguoiDung()
        {
            return NDDAO.DanhSachNguoiDung();
        }
    }
}
